package com.hxzon.netty.statistics.util;

import java.io.IOException;
import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class StatisticsConfig {
    private static final Logger logger = LoggerFactory.getLogger(StatisticsConfig.class);
    private static Properties config;
    static {
        config = new Properties();
        try {
            config.load(StatisticsConfig.class.getResourceAsStream("/config.properties"));
        } catch (IOException e) {
            logger.error("加载配置文件出错", e);
        }
    }

    public static int getPort() {
        return Integer.valueOf(config.getProperty("port"));
    }

    public static int getWorkerCount() {
        return Integer.valueOf(config.getProperty("workerCount"));
    }
}
